package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016103100780586";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC0C8xRwquFhgs2Bg6r1XRr1enrNgTDUTs/ofqvnF1bEjY1RMmDmD8wvewlIel3R6JY9zDzNTXapcEQNCGaBpB4Ghe68oL773f79dviqGujy0+Wx9aHsjzHmJ+QM4M4YF6oIyIWd1pvYaIvAir5kJgdVJG7tD/ZLB1r9p70P7EWP4kpkHR0LYJkCC73GLdIqMZSxlIaIyzi0gdNgo+oKsXUp1gGRwR1lqencQq28NF17/lgnvH8n2RuuphZnjMHDSj7Sj5K30wG3NXgUCkT2GUW6cF+BnkpCniJivSimCQp4BJDR0P9iRKmrV9IK+qD/7pCPiaQ/CZYTiUdtgEQHuYZAgMBAAECggEAcjbByGP7ttpPple1WuAv2HB80Y8U+mo/caBpjJlex3UIGkampuofu+XfNbcLiXVR0aoNzVrF7QwVKxhG8JSVdProbtmEqhlBPf67HE/G6MMCnB3tQ2uYDu4M2scyyMKpiXOwHhxcrCd9YOC5LlPBi2mogTBZCIVprKFoOH1m8zsONsJn2xSJxlLZBZSLsrnFVlqxA8Vt7alnGkiJ1vcJqUMso8NIlGDm5P+WOYbHhYeL+mukxl4+tNPkRci60N+jJZ4HgvWg40SnGmXHlcdwdfSroce+VCZZ88qiLiEDUJExTFLtyC7healsXc1N0C8xRnDcRANTFkCXjDeEMfTJuQKBgQDgtJoIwe/Fv9jq2jB8svKX1c6Gjnp+FqUWdojWtRePDVsHAahgY5ga0L6qSJXdmIMpArwYO10Kj68xlA1TiJRDzCUz2cJdco4NLxBiNpmDu9zd1KqADhpgdNOcG1b4N7FeYJCcUEhb9gC3FVgBhA0eEo80Ap+oJ59qVmHAmoj/9wKBgQDNHvXc2myBZiXvXjsKvndvLhzB6Xy01nNhTkoHxWRRvCwTTMOC1UhcWoSLKJtnpv8sTSO4gNfqM3Z9QvrLQyVvCO9jVAeENK58DBglYBDRuy1kZDyhNgC+bIvDBvIMeHESNk8YHyqC1sj4TXfORCgMxpuPB7HuKg8P0t/YHUDmbwKBgBo0lb4tt+PNAuQou/ze9bHFaoeAuEJaK7iZ7E114yB4w0Pm6pcLJmMCMyoyut+T+L/gpMUCr1Aa/6h9hqxWQkxB05jfbW5ufKiG85cwnOijERgBxDyY6HSVS1RqT9M004eZJWRFbJrk7qJrZ88NcmYuber331zB+jJxjobivtVzAoGAbzm3lg92wN/z+A0/tL69IrN9coS6U5DptbzvFbGqiUuhFsIMThh7CWEn+BGH2zfJrGsT0ItFCUDoolm8hpWdac0Nie3ZuY2bg7ZHLZUe6as2nPZhjgUreBaB3roYbDyvC3IZh3n24kW3ajUPnvCESxEy7ub8S6nQywLM0HJka88CgYBswNAqMrL+BtUe4XTm9TJqLA8EPQzVhYr2UzYFw0qQoPnqjoS4mMl7liIMyP5O6nsbgxLsU9G7LZqW4pr28HyIU4A0UJIdlfYSijF3F+Yv2UQ/wmXYqCE7bZZqvKhRvGZNrSdRT41XBca+yxJOV+jUVOzFFfCR3pRiumRAy9kr5Q==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjzSP9fkKaw/uK4imljq5vB606UybhDfpjb+bOpbIfxOql/5s0zY873yq+VkbmoJGY1znuNg2z7ln24YXSWjAC7rh5S6d3SnBBNBtRTETB2W3QM4r7OpNfpt/IxZuqk8lvtBiQNTHApjrv7slOvhoknLB4lgTlUycQBnicTQixtJiIPI2vwJOy8c6f7f2F47c9Uk3rgOgscZ4CIJRHDnDgyUycmLbk7YxjGNQZKL6O/S1ScG6JK0RO0nFm+2S64yIw29lvrFgoOl/3BAgIRpSne+Zhdfl5UGoQlYWGNpk++mSV4YOaZZNy+O6TBoliOo2JPjmNU0e/I4Hp3odzsQdhQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "https://q53270715z.zicp.fun/fanhui/retrunDB";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "https://q53270715z.zicp.fun/fanhui/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";

//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
